Skip to content

Fix DTW boundary guards and seek loop in transcribe_chunk#3

Merged
TroyHernandez merged 1 commit into
mainfrom
fix/seek-loop-and-dtw-guards
Feb 27, 2026
Merged

Fix DTW boundary guards and seek loop in transcribe_chunk#3
TroyHernandez merged 1 commit into
mainfrom
fix/seek-loop-and-dtw-guards

Conversation

@TroyHernandez

Copy link
Copy Markdown
Contributor

Summary

  • alignment.R: Guard for loops in dtw_align() with if (n >= 2L) checks. When n or m is 1, 2:1 produces c(2, 1) instead of an empty sequence, causing out-of-bounds indexing.
  • transcribe.R: Break seek loop when seek position exceeds mel frames (prevents slicing past end). Accumulate all_generated tokens across loop iterations (previously only kept last chunk's tokens).

Test plan

  • Run R CMD check
  • Test on short audio clips that produce single-segment transcriptions (triggers DTW edge case)

alignment.R: Guard for-loops in dtw_align() against n/m == 1, where
2:1 produces c(2,1) instead of an empty sequence, causing OOB access.

transcribe.R: Break seek loop when seek exceeds mel frames, and
accumulate all_generated tokens across loop iterations.
@TroyHernandez TroyHernandez merged commit 2879877 into main Feb 27, 2026
2 checks passed
@TroyHernandez TroyHernandez deleted the fix/seek-loop-and-dtw-guards branch March 13, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant